import service from '@/utils/request'

/**
 * @签呈列表
 */
export function getPetitionList(data) {
  return service({
    url: '/templatePetition/petition/list',
    method: 'post',
    isRemote: true,
    data
  })
}


/**
 * @签呈详情
 */
export function getPetitionDetail(data) {
  return service({
    url: '/templatePetition/petition/getMyDetail',
    method: 'post',
    isRemote: true,
    data
  })
}

/**
 * @开启签呈
 */
export function openPetitionApi(data) {
  return service({
    url: '/templatePetition/petition/open',
    method: 'post',
    isRemote: true,
    data
  })
}

/**
 * @关闭签呈
 */
export function closePetitionApi(data) {
  return service({
    url: '/templatePetition/petition/close',
    method: 'post',
    isRemote: true,
    data
  })
}

/**
 * @拒签签呈
 */
export function rejectPetitionApi(data) {
  return service({
    url: '/templatePetition/petition/reject',
    method: 'post',
    isRemote: true,
    data
  })
}
/**
 * @完成签字
 */
export function completeSignOver(data) {
  return service({
    url: '/templatePetition/petition/sign',
    method: 'post',
    isRemote: true,
    data
  })
}

/**
 * @签呈模板文件
 */
export function getSignTemplateFile(id) {
  return service({
    url: '/templateBasic/getFile',
    method: 'post',
    responseType: 'blob',
    isRemote: true,
    data: {
      id
    }
  })
}

/**
 * @上传签字图片和签章图片
 */
export function uploadSignatureImage(data) {
  return service({
    url: '/templateUserSignature/addMySignature',
    method: 'post',
    isRemote: true,
    data
  })
}

/**
 * @获取我的签字和印章
 */
export function getMySignature(data) {
  return service({
    url: '/templateUserSignature/getMySignature',
    method: 'post',
    isRemote: true,
    data
  })
}

/**
 * @下载签呈
 */
export function downloadPetition(data) {
  return service({
    url: '/templatePetition/petition/downSignFile',
    method: 'post',
    responseType: 'blob',
    isRemote: true,
    data
  })
}